/**
 * 
 */
package org.musicguardian.core.transactions;

import java.util.Date;
import org.musicguardian.core.model.Library;
import org.musicguardian.core.model.Model;
import org.prevayler.TransactionWithQuery;

/**
 * @author alfredo
 * 
 */
public class LocalLibraryCreateTransaction implements TransactionWithQuery {
    private Library library;

    public LocalLibraryCreateTransaction() {
	super();
    }

    /**
         * @param artists
         */
    public LocalLibraryCreateTransaction(Library library) {
	this.library = library;
    }

    /**
         * @param prevalentSystem
         * @param executionTime
         * @return
         */
    public Object executeAndQuery(Object prevalentSystem, Date executionTime)
	    throws Exception {
	((Model) prevalentSystem).addLocalLibrary(library);
	return library;
    }

}